<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <meta name="twitter:site" content="@metroui">
    <meta name="twitter:creator" content="@pimenov_sergey">
    <meta name="twitter:card" content="summary">
    <meta name="twitter:title" content="Metro 4 Components Library">
    <meta name="twitter:description" content="Metro 4 is an open source toolkit for developing with HTML, CSS, and JS. Quickly prototype your ideas or build your entire app with responsive grid system, extensive prebuilt components, and powerful plugins  .">
    <meta name="twitter:image" content="https://metroui.org.ua/images/m4-logo-social.png">

    <meta property="og:url" content="https://metroui.org.ua/v4/index.html">
    <meta property="og:title" content="Metro 4 Components Library">
    <meta property="og:description" content="Metro 4 is an open source toolkit for developing with HTML, CSS, and JS. Quickly prototype your ideas or build your entire app with responsive grid system, extensive prebuilt components, and powerful plugins  .">
    <meta property="og:type" content="website">
    <meta property="og:image" content="https://metroui.org.ua/images/m4-logo-social.png">
    <meta property="og:image:secure_url" content="https://metroui.org.ua/images/m4-logo-social.png">
    <meta property="og:image:type" content="image/png">
    <meta property="og:image:width" content="968">
    <meta property="og:image:height" content="504">

    <meta name="author" content="Sergey Pimenov">
    <meta name="description" content="The most popular HTML, CSS, and JS library in Metro style.">
    <meta name="keywords" content="HTML, CSS, JS, Metro, CSS3, Javascript, HTML5, UI, Library, Web, Development, Framework">

    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
    <link rel="icon" href="favicon.ico" type="image/x-icon">

    <link href="metro/css/metro-all.css?ver=@@b-version" rel="stylesheet">
    <link href="highlight/styles/github.css" rel="stylesheet">
    <link href="docsearch/docsearch.min.css" rel="stylesheet">
    <link href="css/site.css" rel="stylesheet">

    <title>M4Q DataSet - Metro 4 :: Popular HTML, CSS and JS library</title>
</head>
<body class="m4-cloak">

<header data-role="html-container" data-insert-mode="replace" data-html-source="header.html"></header>

<div data-role="html-container" data-insert-mode="replace" data-html-source="sidebar-menu.html"></div>

<div class="container-fluid docs-content">

    <div class="row flex-xl-nowrap">

            <div class="d-none d-block-xl cell-xl-2 order-2 border-left bd-light toc-wrapper">
                <h5>Table of contents</h5>
                <hr/>
                <ul class="toc-nav">
                    <li class="toc-entry"><a href="#">About</a></li>
                    <li class="toc-entry"><a href="#_func_has_data">$.hasData()</a></li>
                    <li class="toc-entry"><a href="#_func_data">$.data()</a></li>
                    <li class="toc-entry"><a href="#_func_remove_data">$.removeData()</a></li>
                    <li class="toc-entry"><a href="#_func_fn_data">$(...).data()</a></li>
                    <li class="toc-entry"><a href="#_func_fn_remove_data">$(...).removeData()</a></li>
                </ul>

            </div>

            <main class="cell-xl-10 order-1 pr-1-sx pl-1-sx pr-5-md pl-5-md">
                <div class="place-right d-none d-block-lg" style="width: 200px;">
                    <img src="images/logo.png" class="w-100" alt="">
                </div>

                <h1>M4Q DataSet</h1>
                <p class="text-leader">
                    Store arbitrary data associated with the matched elements or specified element.
                </p>

                <!-- ads-html -->

                <h3 id="_func_about">About</h3>
                <p>
                    M4Q contains methods for data, associated with elements. These methods allow us to associate arbitrary data with specific DOM elements.
                </p>

                <h3 id="_func_has_data">$.hasData()</h3>
                <p>
                    Determine whether an HTMLElement has any <code>m4q</code> data associated with it. If there is no data object associated with an element, the method returns false; otherwise it returns true.
                </p>
                <pre><code>
                    var elem = $('#elem')[0];
                    if ( $.hasData(elem ) {
                        console.log("Element has a data");
                    }
                </code></pre>

                <h3 id="_func_data">$.data()</h3>
                <p>
                    Store arbitrary data associated with the specified HTMLElement and/or return the value that was set.
                </p>
                <p class="remark">
                    This is a low-level method; a more convenient <code>$(...).data()</code> is also available.
                </p>
                <pre><code>
                    $.data( document.body, "foo", 52 );
                    $.data( document.body, "bar", "test" );
                </code></pre>

                <h3 id="_func_remove_data">$.removeData()</h3>
                <p>
                    Remove a previously-stored piece of data for HTMLElement.
                </p>
                <p class="remark">
                    This is a low-level method; a more convenient <code>$(...).removeData()</code> is also available.
                </p>
                <pre><code>
                    $.removeData( document.body, "foo");
                </code></pre>

                <h3 id="_func_fn_data">$(...).data()</h3>
                <p>
                    Store arbitrary data associated with the matched elements or return the value at the named data store for the first element in the set of matched elements.
                </p>
                <pre><code>
                    $( "body" ).data( "foo", 52 );
                    $( "body" ).data( "bar", { isManual: true } );
                    $( "body" ).data( "baz", [ 1, 2, 3 ] );
                    console.log( $( "body" ).data( "foo" ) ); // Outputs: 52
                    console.log( $( "body" ).data(0) ); // Outputs: { foo: 52, bar: { isManual: true }, baz: [ 1, 2, 3 ] }
                </code></pre>

                <h3 id="_func_fn_remove_data">$(...).removeData()</h3>
                <p>
                    Remove a previously-stored piece of data for the matched elements.
                    The <code>.removeData()</code> method allows us to remove values that were previously set using <code>.data()</code>.
                    When called with the name of a key, <code>.removeData()</code> deletes that particular value.
                    When called with no arguments, <code>.removeData()</code> removes all values.
                </p>
                <pre><code>
                    $( "body" ).removeData( "foo" ); // remove data with key foo
                    $( "body" ).removeData( ); // remove all stored data
                </code></pre>
            </main>
        </div>

    </div>

    <script src="docsearch/docsearch.min.js"></script>


    <script src="metro/js/metro.js?ver=@@b-version"></script>
    <script src="highlight/highlight.pack.js"></script>
    <script src="js/clipboard.min.js"></script>
    <script src="js/site.js"></script>
    <!-- ads-script -->
    <!-- ga-script -->
    <!-- hit-ua -->
</body>
</html>